import request from '@/plugins/axios/request';
// let baseURL = "http://127.0.0.1:3000/facilities"
let baseURL = process.env.VUE_APP_BASE_API

export function uploadFile(data) {
  return request({
    url: `${baseURL}/upload`,
    method: 'POST',
    data: data,
    isShowMessage: true
  })
}

export function deleteFile(filename) {
  return request({
    url: `${baseURL}/delete/${filename}`,
    method: 'DELETE',
    isShowMessage: true
  })
}

export function downloadFile(filename, name) {
  return request({
    url: `${baseURL}/download`,
    method: 'GET',
    params: {
      filename: filename,
      name: name
    },
    isShowMessage: false,
    isDownLoadFile: true
  })
}